fix: Suppress altair/narwhals warning and fix data URL paths#20
fix: Suppress altair/narwhals warning and fix data URL paths#20
Conversation
- Add warnings filter to suppress narwhals is_pandas_dataframe warning in all 3 notebooks - Fix warehouse_location_part_1 and part_2 to use correct wlp data path instead of cog
|
hi @NikoStein - sorry to comment here, just wanted to ask about the warning you were seeing from altair which version of altair were you running? i was under the impression that this had been fixed in more recent versions |
|
Hi @MarcoGorelli - thanks for reaching out. For me, it also worked fine when running it locally. However, running it using WASM it still get this warning: /lib/python3.12/site-packages/altair/utils/data.py:71: UserWarning: You passed a Hint: Instead of e.g. Hint: Instead of e.g. You can try yourself here: https://d3group.github.io/OM-lecture/center_of_gravity/ I think there might be an older version on micropip maybe. |
|
thank you! i see it now, yes, looks like there's altair v 5.4.1 there 😩 🤔 maybe the warning should just be removed from narwhals if it ends up being disruptive like this |
|
though https://pyodide.org/en/stable/usage/packages-in-pyodide.html shows that it should already be using altair 5.5 🤔 sorry for the noise 😄 will investigate |
|
marimo is currently using Pyodide 0.27, as some packages we disabled to get the Pyodide 0.28 release out are unfortunately still disabled in Pyodide 0.29. Pyodide 0.27 has an older version of Altair, which you see in the notebook at https://d3group.github.io/OM-lecture/center_of_gravity/. The webpage at pyodide.org/en/stable/usage/packages-in-pyodide.html contains the list of packages on the current 0.29 branch, where Altair has beenh updated. xref: pyodide/pyodide-recipes#99, marimo-team/marimo#5995 I wonder if there could be a mechanism in marimo to use a newer Pyodide version (JupyterLite supports this) without having to hardcode the version for everyone, though I'm by no means familiar with marimo's codebase 😄 |
|
To be honest I do not know what the issue is but it would be great if this could be fixed. Especially as altair is marimos goto plotting library it would be nice if it works in all modes without warnings :) |

Summary
is_pandas_dataframewarning in Altair 6.xwarehouse_location_part_1.pyandwarehouse_location_part_2.pyto use correctwlpdata path instead ofcogFiles Changed
apps/center_of_gravity.py- added warnings filterapps/warehouse_location_part_1.py- added warnings filter + fixed data URLapps/warehouse_location_part_2.py- added warnings filter + fixed data URLTest plan